﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Model.Base
{
    public class Page<T>
    {
        /// <summary>
        /// 每页条数
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 当前页数
        /// </summary>
        public int PageCount { get; set; }
        /// <summary>
        /// 总页数
        /// </summary>
        public int PageTotal
        {
            get
            {
                if(PageSize > 0 && Total > 0)
                {
                    int c = Total / PageSize;
                    if(Total % PageSize > 0)
                    {
                        c += 1;
                    }
                    return c;
                }
                return 0;
            }
        }
        /// <summary>
        /// 总条数
        /// </summary>
        public int Total { get; set; }

        public List<T> Rows { get; set; }
    }
}
